import request from '@/utils/request';

// 获取地图设定分页列表
export function getMapSettingList(params) {
  let url = process.env.VUE_APP_SERVICE_NAME + 'api/sysMapCoefficient/getListByPage';
  return request({
    url: url,
    method: 'post',
    data: params
  });
}

// 获取地区架构列表--根据登陆的用户
export function getAreaList() {
  let url = process.env.VUE_APP_SERVICE_NAME + 'api/sysRegMapStruct/getDropDownListByUserId';
  return request({
    url: url,
    method: 'get'
  });
}

// 获取实时车辆统计
export function getRealtimeCarStatisticApi(params) {
  let url = process.env.VUE_APP_BUS_SERVICE_NAME + 'api/realtimeinfo/getVehicleNum';
  return request({
    url: url,
    method: 'post',
    data: params,
    disableLoading: true
  });
}

// 获取区域排放时长今日
export function getAreaDischargeApi(vehicleId = 0) {
  let url = process.env.VUE_APP_BUS_SERVICE_NAME + 'api/realtimeinfo/getRegDisTimeStatis';
  return request({
    url: url,
    method: 'post',
    data: {
      vehicleId: vehicleId
    }
  });
}

// 获取车辆排放量当月/当周
export function getWeekDischargeApi(params) {
  let url = process.env.VUE_APP_BUS_SERVICE_NAME + 'api/realtimeinfo/getDisTimeStatis';
  return request({
    url: url,
    method: 'post',
    data: params
  });
}

// 首页地图数据
export function getMapStatisticApi(params) {
  let url = process.env.VUE_APP_BUS_SERVICE_NAME + 'api/realtimeinfo/getMapRegStatis';
  return request({
    url: url,
    method: 'get'
  });
}

// 获取全部报警信息
export function getAlertData(data) {
  return request({
    url: process.env.VUE_APP_BUS_SERVICE_NAME + 'api/ottAlarmInfo/getListByPage',
    method: 'post',
    data: data,
    disableLoading: true
  });
}

// 解除报警
export function releaseAlertApi(id) {
  return request({
    url: process.env.VUE_APP_BUS_SERVICE_NAME + 'api/ottAlarmInfo/clearAlarm',
    method: 'get',
    params: {
      objectId: id
    }
  })
}
